Skip to content

Find the active formatting pin without allocating - #2331

Draft
oxura wants to merge 1 commit into
bendlang:mainfrom
oxura:fix/fmt-active-pin-20261124
Draft

oxura wants to merge 1 commit into
bendlang:mainfrom
oxura:fix/fmt-active-pin-20261124

Conversation

@oxura

@oxura oxura commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Look backward for the last usable layout pin. No temporary array, and the selection order stays the same.

On a 300-declaration module, the lookup went from 2,703 arrays to zero. The formatted output was identical, and both files ran with the same output through the Bend CLI. The formatter's 37 tests (including the stdio LSP session) and the repo gate (56/56) pass on Linux. Draft because I couldn't run the mini gates.

Fixes #2330

Walk back from the newest pin and stop as soon as a usable column is found.

Fixes bendlang#2330
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bend-fmt-lsp allocates a pin list for each unanchored line

1 participant